package com.learn.hibernatevalidator.chapter01;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: liyf
 * @create: 2024-12-19 21:40
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Car {

    /**
     * @NotNull 值不能为 null
     */
    @NotNull
    private String manufacturer;

    /**
     * licensePlace不能为null, 并且长度必须介于2到14之间
     */
    @NotNull
    @Size(min = 2, max = 14)
    private String licensePlace;

    /**
     * seatCount 值不能小于2
     */
    @Min(2)
    private int seatCount;


}
